Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow numbers as second input event #8471

Merged
merged 4 commits into from
Feb 14, 2024
Merged

Conversation

areux
Copy link
Contributor

@areux areux commented Oct 6, 2023

This will allow using numbers as second key event. Closes #8113

This will allow using numbers as second key event.
@areux areux closed this Oct 6, 2023
@areux areux reopened this Oct 6, 2023
@areux areux changed the title Make sure pending key list is empty when count handling Make sure pending key list is empty when handling count Oct 6, 2023
@kirawi kirawi added the A-helix-term Area: Helix term improvements label Oct 6, 2023
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the solution for #8113 should be to look up the key event in the keymap before considering it for a count. If it's a possible keybinding (pending or command(s)) then it can just be used for the keybinding and if it isn't then it can be considered part of a count.

helix-term/src/ui/editor.rs Outdated Show resolved Hide resolved
@the-mikedavis the-mikedavis added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 6, 2023
@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 16, 2023
@areux areux changed the title Make sure pending key list is empty when handling count Allow numbers as second input event Oct 29, 2023
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, this fell of my radar for a while. I have only some minor nits.

helix-term/src/keymap.rs Outdated Show resolved Hide resolved
helix-term/src/keymap.rs Outdated Show resolved Hide resolved
@the-mikedavis the-mikedavis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from a maintainer. labels Feb 11, 2024
@areux
Copy link
Contributor Author

areux commented Feb 14, 2024

Thanks for helping with this, I renamed the function and fixed the allocation issue.
I'm not familiar with helix source code, just followed what you said in your first comment and made these changes. I hope they're in the right places!

Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 14, 2024
@pascalkuthe pascalkuthe merged commit 4df08dd into helix-editor:master Feb 14, 2024
6 checks passed
@tmke8 tmke8 mentioned this pull request Feb 14, 2024
cosmikwolf pushed a commit to cosmikwolf/helix that referenced this pull request Feb 26, 2024
* Make sure pending key list is empty when count handling

This will allow using numbers as second key event.

* count handling; add an exception for 'g'

* Lookup the key event before considering a number as count

* Avoid the allocation of another vec for the pending keys

---------

Co-authored-by: x <x@torrent>
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 4, 2024
* Make sure pending key list is empty when count handling

This will allow using numbers as second key event.

* count handling; add an exception for 'g'

* Lookup the key event before considering a number as count

* Avoid the allocation of another vec for the pending keys

---------

Co-authored-by: x <x@torrent>
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
* Make sure pending key list is empty when count handling

This will allow using numbers as second key event.

* count handling; add an exception for 'g'

* Lookup the key event before considering a number as count

* Avoid the allocation of another vec for the pending keys

---------

Co-authored-by: x <x@torrent>
Vulpesx pushed a commit to Vulpesx/helix that referenced this pull request Jun 7, 2024
* Make sure pending key list is empty when count handling

This will allow using numbers as second key event.

* count handling; add an exception for 'g'

* Lookup the key event before considering a number as count

* Avoid the allocation of another vec for the pending keys

---------

Co-authored-by: x <x@torrent>
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
* Make sure pending key list is empty when count handling

This will allow using numbers as second key event.

* count handling; add an exception for 'g'

* Lookup the key event before considering a number as count

* Avoid the allocation of another vec for the pending keys

---------

Co-authored-by: x <x@torrent>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow numbers as second input event
4 participants